<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        //String number boolean null undefind
        let obj={
            name:'tom',
            age:'15',
            phone:'123456'
        }
        //console.log(obj);
      //  {...this.obj}

      //console.log({money: '100',...obj});
      
      //对象拷贝
    //  let newObj=obj //浅拷贝
      
    //深拷贝
    //第一种JSON.stringify 
    //let newObj =JSON.parse(JSON.stringify(obj))

    //第二种 --->原生代码  递归循环

    //第三种 ...展开符
    //let newObj={...obj}

    //第四种  对象的深拷贝  对象合并  
    let newObj=Object.assign({},obj,{money:100,test:123},{test:12312})

      console.log("Object.assign",newObj);
      newObj.name='bob'

      console.log('newObj',newObj.name);
      console.log('obj',obj.name);

    </script>
</body>
</html>